package com.maxjay.component.metadata.core.command;

import java.util.ArrayList;
import java.util.List;

import com.maxjay.component.metadata.model.Entity;

/**
 * Entity的删除命令
 * 
 * @author zhaixm
 *
 */
public class DeleteEntityCommand extends JdbcEntityCommand {
	
	private List<String> keyFieldValues = new ArrayList<String>(0);

	public DeleteEntityCommand(Entity entity, String keyFieldValue) {
		super(entity);
		this.keyFieldValues.add(keyFieldValue);
	}

	public DeleteEntityCommand(Entity entity, List<String> keyFieldValues) {
		super(entity);
		this.keyFieldValues = keyFieldValues;
	}
	
	@Override
	public void execute() {
		this.getEntityService().delete(entity, keyFieldValues);
	}

}
